
local rpc = require 'rpc'
local interface = require 'interface'
local socket = require 'socket'
local serialize = require'serialize'

local IP = "localhost"
local port = 55000

--local start = io.read()

local p = rpc.createproxy( IP, port, interface )
local p2 = rpc.createproxy( IP, port, interface )

-- Create string
local smallString = "aaaaaaaa"
local bigString = ""
for i=1, 2024 do
  bigString = bigString .. "a"  
end

-- Execute method bar with smallString
for i=1, 50 do
  --print("Client_smallString - Interacao " .. i, p.bar( smallString ))
  p.bar( smallString )
end

-- Execute method bar with bigString
for i=1, 50 do
  --print("Client_bigString - Interacao " .. i, p.bar( bigString ))
  p.bar( bigString )
end

local tab = {}
for i=1,100 do
  table.insert(tab,10.5)
end

local t_str = serialize('t',tab)
t_str = string.gsub(t_str,"\n","")
t_str = t_str .. ' return t'
p2.bar(t_str)
print(socket.gettime())
